//
//  CXYSongsmMenuCollectionReusableView.m
//  NewMusic
//
//  Created by chuxinyu123 on 15/11/21.
//  Copyright © 2015年 Going. All rights reserved.
//

#import "CXYSongsmMenuCollectionReusableView.h"

@implementation CXYSongsmMenuCollectionReusableView
- (void)dealloc
{
    [_titleLabel release];
    [_string release];
    [super dealloc];
}
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createTitleLabel];
    }
    return self;
}

- (void)createTitleLabel
{
    self.titleLabel = [[UILabel alloc] init];
    self.titleLabel.textColor = [UIColor whiteColor];
    self.titleLabel.font = [UIFont systemFontOfSize:25];
    [self addSubview:_titleLabel];
    [_titleLabel release];
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    self.titleLabel.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height);
}

- (void)setString:(NSString *)string
{
    if (_string != string) {
        [_string release];
        _string = [string retain];
    }
    _titleLabel.text = string;
}

@end
